﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class ProvinceCluster : ActiveRecordBase<ProvinceCluster>
    {
        #region Const Definition

        public const string CONST_ProvinceClusterID = "ProvinceClusterID";
        public const string CONST_ClusterCode = "ProvinceCode";
        public const string CONST_ClusterEName = "ClusterEName";
        public const string CONST_ClusterCName = "ClusterCName";
        public const string CONST_Sort = "Sort";
        public const string CONST_IsActive = "IsActive";

        #endregion

        #region Member Variables
        // Primary Key
        private System.Int32 _provinceClusterID;

        // Non Key
        private System.String _clusterCode;
        private System.String _clusterEName;
        private System.String _clusterCName;
        private System.Int32 _sort;
        private System.Boolean _isActive;

        // Parents

        #endregion

        public ProvinceCluster()
        {

        }
        public ProvinceCluster(
            System.String clusterCode
            , System.String provinceEName
            , System.String provinceCName
            , System.Int32 sortNumber
            , System.Boolean active)
            : this()
        {

            this._clusterCode = clusterCode;
            this._clusterEName = provinceEName;
            this._clusterCName = provinceCName;
            this._sort = sortNumber;
            this._isActive = active;
        }

        #region Properties
        // Primary Key        

#if (SQLServer)
        [PrimaryKey]
#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_PROVINCE_PROVINCEID")]
#endif
        public System.Int32 ProvinceClusterID
        {
            get { return this._provinceClusterID; }
            set { this._provinceClusterID = value; }
        }

        // Non Key
        [Property]
        public System.String ClusterCode
        {
            get { return this._clusterCode; }
            set { if (value == null) return; if (value.Length > 50) this._clusterCode = value.Substring(0, 50); else this._clusterCode = value; }
        }

        [Property]
        public System.String ClusterEName
        {
            get { return this._clusterEName; }
            set { if (value == null) return; if (value.Length > 100) this._clusterEName = value.Substring(0, 100); else this._clusterEName = value; }
        }

        [Property]
        public System.String ClusterCName
        {
            get { return this._clusterCName; }
            set { if (value == null) return; if (value.Length > 20) this._clusterCName = value.Substring(0, 20); else this._clusterCName = value; }
        }

        [Property]
        public System.Int32 Sort
        {
            get { return this._sort; }
            set { this._sort = value; }
        }

        [Property]
        public System.Boolean IsActive
        {
            get { return this._isActive; }
            set { this._isActive = value; }
        }


        // Parent Relationships
        // Child Relationships


        #endregion

        // Clone
        public ProvinceCluster Clone()
        {
            ProvinceCluster newProvince = new ProvinceCluster();

            newProvince.ClusterCode = this._clusterCode;
            newProvince.ClusterEName = this._clusterEName;
            newProvince.ClusterCName = this._clusterCName;
            newProvince.Sort = this._sort;
            newProvince.IsActive = this._isActive;
            return newProvince;
        }
    }
}



